import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  
  { path: '/discover', 
    component: ()=>import(/*webpackChunkName:'discover'*/'@/pages/discover')
  },
  
  { path: '/friend', 
    component: ()=>import(/*webpackChunkName:'friend'*/'@/pages/friend'),
    children:[
      {
        path:'film',
        component:()=>import(/*webpackChunkName:'film'*/'@/pages/friend/film')
      },
      {
        path:'music',
        component:()=>import(/*webpackChunkName:'music'*/'@/pages/friend/music')
      }
    ]
  },
  { path: '/mine', 
    component: ()=>import(/*webpackChunkName:'mine'*/'@/pages/mine'),
  },
  { path: '/list', 
    component: ()=>import(/*webpackChunkName:'list'*/'@/pages/list')
  },
  { path: '/detail/:productid', 
    component: ()=>import(/*webpackChunkName:'detail'*/'@/pages/detail')
  },
  {
    path: '*',
    component : ()=>import(/*webpackChunkName:'page404'*/'@/pages/page404')
  }
];

const router = new VueRouter({
  routes,
});

export default router;
